It was also punishable by death to have sex with a married woman. Also it was a penalty of death to murder another person. Saying sorry wasn't a condition to get out of it. It was also against the law to count the people. How many died because of it? All of these things were done by David. He got confronted and only then did he say sorry.
I guess it's good to be a favorite of God - you get to say sorry and live. Unlike the regular people like Uzzah. He didn't a chance to repent. And as I said before, David was responsible for not having it carried by the levites.
NOVEMBER 15, 2012 study article
Life was considered sacred under the Law. A deliberate murderer could in no way be exonerated. He was to be put to death without fail. Thus in Numbers 35:30-33 we read: “Every fatal striker of a soul should be slain as a murderer at the mouth of witnesses, and one witness may not testify against a soul for him to die. And you must take no ransom for the soul of a murderer who is deserving to die, for without fail he should be put to death. . . . And you must not pollute the land in which you are; because it is blood that pollutes the land, and for the land there may be no atonement respecting the blood that has been spilled upon it except by the blood of the one spilling it.” This law removed such a wicked person from Israelite society. He did not run free to commit more murders.
I am not saying that there shouldn't be consequences for actions that hurt others. I am showing that God picks and chooses his justice depending on the person - it isn't consistent. Is it fair that the child died because of David and Bathsheba's lust?
From the same study article as above:
(Deuteronomy 24:16) 16 “Fathers should not be put to death on account of children, and children should not be put to death on account of fathers. Each one should be put to death for his own sin.